import { request } from '@/request/request'
import {
  GetManagerRolesApiDataType,
  GetManagerRolesApiResType,
  GetManagerRolesListType,
  GetManagerRoleApiDataType,
  GetManagerRoleApiResType,
  ModifyManagerRolesApiDataType,
} from '#/mms/managerRoleType'

export const GetManagerRolesApi = (
  data: GetManagerRolesApiDataType
): PromiseRes<GetManagerRolesApiResType> =>
  request.get('/mms/list', { params: data })

export const ModifyManagerRoleApi = (
  data: GetManagerRolesListType
): PromiseRes<null> => request.post('/mms/modify', data)

export const GetManagerRoleApi = (
  data: GetManagerRoleApiDataType
): PromiseRes<GetManagerRoleApiResType> =>
  request.get('/admin/role', { params: data })

export const ModifyManagerRolesApi = (
  data: ModifyManagerRolesApiDataType
): PromiseRes<null> => request.post('/admin/role/update', data)
